﻿using System;
using System.Collections.Generic;
using System.Text;
using log4net;

namespace RouterControl.IO
{
	/// <summary>
    /// version format:
    ///     major . minor . release . continuous
    ///     
    /// examples:
    ///     v1.1 CTP1       -> 1.1.0.0
    ///     v1.1 CTP2       -> 1.1.1.0
    ///     v1.1 CTP2 R2    -> 1.1.1.1
    ///     v1.1 beta 1     -> 1.1.2.0
    ///     v1.1 beta 2     -> 1.1.3.0
    ///     v1.1 RC1        -> 1.1.4.0
    ///     v1.1 RTM        -> 1.1.5.0
    /// 
	/// contains the version information and should match the following places:
	/// 
    /// RouterControl.WixSetup/Product.wxs: &lz;Product Name="" Version="" /&gt;
	/// RouterControl.Whs/Properties/AssemblyVersion.cs: assembly version
	/// RouterControl.Website/App_Code/AssemblyVersion.cs: assembly version
	/// RouterControl database table: Releases
	/// </summary>
	public static class RouterControlVersion
	{
        public const int VersionId = 20090921;
        public const bool VersionIsBeta = true;

        public const string VersionString = "1.2 CTP2";
        public const string VersionNumberString = "1.2.1.0";

		public static void LogVersion()
		{
		    LogVersion(null);
		}

		public static void LogVersion(ILog log)
		{
            if (log == null)
                log = LogManager.GetLogger(typeof(RouterControlVersion));

			log.InfoFormat(
				"Router Control - v{0} (#{1})",
				VersionString,
				VersionId
				);
		}
	}
}
